# 订单信息
order_number = "DH202311010001"
time = "2023-11-01 20:56:15"

# 商品列表，每个元素为（名称，数量，单价，金额）
goods = [
    ("金士顿U盘8G", 1, 40.00, 40.00),
    ("胜创16GTF卡", 1, 50.00, 50.00),
    ("读卡器", 1, 8.00, 8.00),
    ("网线2米", 1, 5.00, 5.00)
]

# 计算总数和原价总额
total_count = len(goods)
original_total_amount = sum(good[3] for good in goods)
# 计算折后总额（9折）
discounted_amount = original_total_amount * 0.9
actual_amount = discounted_amount
change = 0.00
cashier = "管理员"

# 构建小票内容
receipt = f"单号: {order_number}\n"
receipt += f"时间: {time}\n\n"
receipt += "名称          数量  单价   金额\n"
for good in goods:
    receipt += f"{good[0]:<14} {good[1]}    {good[2]:<5.2f} {good[3]:<5.2f}\n"
receipt += "\n"
receipt += f"总数: {total_count}\n"
receipt += f"原价总额: {original_total_amount:.2f}\n"
receipt += f"折后总额: {discounted_amount:.2f}\n"
receipt += f"实收: {actual_amount:.2f}\n"
receipt += f"找零: {change:.2f}\n"
receipt += f"收银: {cashier}\n"

# 打印小票
print(receipt)